﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using WCFMINERP.InnerFactory.Presenter;
using WCFMINERP.InnerFactoryContracts.InterFaces;
using WCFMINERP.InnerFactoryContracts.DataContracts;


using System.ServiceModel;

namespace WCFMINERP.InnerFactory.Forms
{
    public partial class FrmPause : Form
    {
        ChannelFactory<IInnerFactory> _proxy;
        IInnerFactory _innerFactory;

        public FrmPause(int inUserId, string inStrBarCode)
        {
            InitializeComponent();
            this.intUserID = inUserId;
            this.strBarCode = inStrBarCode;
            _proxy = new ChannelFactory<IInnerFactory>("IInnerFactory");
            _innerFactory = _proxy.CreateChannel();
        }

        private int intUserID = 0;
        private string strBarCode = "";
        private void simpleButtonOK_Click(object sender, EventArgs e)
        {
            if (this.richTextBox1.Text.Trim().Equals(""))
            {
                MessageBox.Show("请输入暂停生产原因！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            _innerFactory.PauseProduce(intUserID, strBarCode, this.richTextBox1.Text);
            MessageBox.Show("产品暂停生产！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            this.Close();

        }
    }
}
